<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Convert &quot;kana&quot; one from another (&quot;zen-kaku&quot;, &quot;han-kaku&quot; and more)</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.mb-convert-kana" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mb_convert_kana</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.6, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">mb_convert_kana</span> &mdash; <span class="dc-title">Convert &quot;kana&quot; one from another (&quot;zen-kaku&quot;, &quot;han-kaku&quot; and more)</span></p>

 </div>
   
 <div class="refsect1 description" id="refsect1-function.mb-convert-kana-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>mb_convert_kana</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$str</code></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$option</code><span class="initializer"> = &quot;KV&quot;</span></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$encoding</code><span class="initializer"> = mb_internal_encoding()</span></span>
  ]] ) : <span class="type">string</span></div>

  <p class="para rdfs-comment">
   Performs a &quot;han-kaku&quot; - &quot;zen-kaku&quot; conversion for <span class="type"><a href="language.types.string.html" class="type string">string</a></span> <code class="parameter">str</code>. 
   This function is only useful for Japanese.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.mb-convert-kana-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">str</code></dt>

     <dd>

      <p class="para">
       The <span class="type"><a href="language.types.string.html" class="type string">string</a></span> being converted.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">option</code></dt>

     <dd>

      <p class="para">
       The conversion option.
      </p>
      <p class="para">
       Specify with a combination of following options.
       <table class="doctable table">
        <caption><strong>Applicable Conversion Options</strong></caption>
        
         <thead>
          <tr>
           <th>Option</th>
           <th>Meaning</th>
          </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td><em>r</em></td>
           <td>
            Convert &quot;zen-kaku&quot; alphabets to &quot;han-kaku&quot;
           </td>
          </tr>

          <tr>
           <td><em>R</em></td>
           <td>
            Convert &quot;han-kaku&quot; alphabets to &quot;zen-kaku&quot;
           </td>
          </tr>

          <tr>
           <td><em>n</em></td>
           <td>
            Convert &quot;zen-kaku&quot; numbers to &quot;han-kaku&quot;
           </td>
          </tr>

          <tr>
           <td><em>N</em></td>
           <td>
            Convert &quot;han-kaku&quot; numbers to &quot;zen-kaku&quot;
           </td>
          </tr>

          <tr>
           <td><em>a</em></td>
           <td>
            Convert &quot;zen-kaku&quot; alphabets and numbers to &quot;han-kaku&quot;
           </td>
          </tr>

          <tr>
           <td><em>A</em></td>
           <td>
            Convert &quot;han-kaku&quot; alphabets and numbers to &quot;zen-kaku&quot;
            (Characters included in &quot;a&quot;, &quot;A&quot; options are
            U+0021 - U+007E excluding U+0022, U+0027, U+005C, U+007E)
           </td>
          </tr>

          <tr>
           <td><em>s</em></td>
           <td>
            Convert &quot;zen-kaku&quot; space to &quot;han-kaku&quot; (U+3000 -&gt; U+0020)
           </td>
          </tr>

          <tr>
           <td><em>S</em></td>
           <td>
            Convert &quot;han-kaku&quot; space to &quot;zen-kaku&quot; (U+0020 -&gt; U+3000)
           </td>
          </tr>

          <tr>
           <td><em>k</em></td>
           <td>
            Convert &quot;zen-kaku kata-kana&quot; to &quot;han-kaku kata-kana&quot;
           </td>
          </tr>

          <tr>
           <td><em>K</em></td>
           <td>
            Convert &quot;han-kaku kata-kana&quot; to &quot;zen-kaku kata-kana&quot;
           </td>
          </tr>

          <tr>
           <td><em>h</em></td>
           <td>
            Convert &quot;zen-kaku hira-gana&quot; to &quot;han-kaku kata-kana&quot;
           </td>
          </tr>

          <tr>
           <td><em>H</em></td>
           <td>
            Convert &quot;han-kaku kata-kana&quot; to &quot;zen-kaku hira-gana&quot;
           </td>
          </tr>

          <tr>
           <td><em>c</em></td>
           <td>
           Convert &quot;zen-kaku kata-kana&quot; to &quot;zen-kaku hira-gana&quot;
           </td>
          </tr>

          <tr>
           <td><em>C</em></td>
           <td>
            Convert &quot;zen-kaku hira-gana&quot; to &quot;zen-kaku kata-kana&quot;
           </td>
          </tr>

          <tr>
           <td><em>V</em></td>
           <td>
            Collapse voiced sound notation and convert them into a character. Use with &quot;K&quot;,&quot;H&quot;
           </td>
          </tr>

         </tbody>
        
       </table>

      </p>
     </dd>

    
    
     <dt>
<code class="parameter">encoding</code></dt>

     <dd>

      <p class="para"><code class="parameter">encoding</code>
参数为字符编码。如果省略，则使用内部字符编码。</p>
     </dd>

    
   </dl>

  </p>
 </div>

 
 <div class="refsect1 returnvalues" id="refsect1-function.mb-convert-kana-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   The converted <span class="type"><a href="language.types.string.html" class="type string">string</a></span>.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.mb-convert-kana-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-3175">
    <p><strong>Example #1 <span class="function"><strong>mb_convert_kana()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/*&nbsp;Convert&nbsp;all&nbsp;"kana"&nbsp;to&nbsp;"zen-kaku"&nbsp;"kata-kana"&nbsp;*/<br /></span><span style="color: #0000BB">$str&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mb_convert_kana</span><span style="color: #007700">(</span><span style="color: #0000BB">$str</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"KVC"</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/*&nbsp;Convert&nbsp;"han-kaku"&nbsp;"kata-kana"&nbsp;to&nbsp;"zen-kaku"&nbsp;"kata-kana"&nbsp;<br />&nbsp;&nbsp;&nbsp;and&nbsp;"zen-kaku"&nbsp;alpha-numeric&nbsp;to&nbsp;"han-kaku"&nbsp;*/<br /></span><span style="color: #0000BB">$str&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mb_convert_kana</span><span style="color: #007700">(</span><span style="color: #0000BB">$str</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"KVa"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
    </div>

   </div>
  </p>
 </div>


</div></div></div></body></html>